package com.solace.selenium.config;

import cn.hutool.core.io.resource.ResourceUtil;
import com.solace.selenium.service.WebDriverService;
import org.openqa.selenium.JavascriptExecutor;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.firefox.FirefoxDriver;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

@Configuration
public class FirefoxConfig {
    @Autowired
    private WebDriverService webDriverService;
    @Bean
    public FirefoxDriver firefoxDriver() {
        System.setProperty("webdriver.firefox.bin", "C:\\Program Files\\Mozilla Firefox\\firefox.exe");
        //加载驱动
//        System.setProperty("webdriver.firefox.marionette","geckodriver.exe");
        System.setProperty("webdriver.gecko.driver", "C:\\Program Files\\Mozilla Firefox\\geckodriver.exe");
        FirefoxDriver firefoxDriver = new FirefoxDriver();
//        firefoxDriver.get("https://buyin.jinritemai.com");
        firefoxDriver.get("https://buyin.jinritemai.com/mpa/account/login?log_out=1&type=24");
        return firefoxDriver;
    }
}
